package com.huang.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 认证方式枚举
 *
 */
public enum AuthenticationMethodEnum {

    USERNAME("username", "用户名"),
    MOBILE("mobile", "手机号"),
    OPENID("openId", "开放式认证系统唯一身份标识");

    @Getter
    private final String value;

    @Getter
    private final String label;

    AuthenticationMethodEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }

    public static AuthenticationMethodEnum getByValue(String value) {
        return Arrays.stream(values()).filter(k -> k.getValue().equals(value)).findFirst().get();
    }


}
